{% extends "../basepage.html" %}
{% block js %}
<script type="text/javascript" language="javascript" defer="defer">
<!--
window.onload = function checked(){
	var tables = document.getElementsByTagName("table");
	var arr = new Array();
	var minLength=0;
	for (i=0;i<tables.length;i++){
		if(tables[i].id!="main" && tables[i].id!=""){
			arr[i-1] = tables[i].id;
			if(i == 1){
				tables[i].style.margin="0px,0px,10px,0px";
				minLength = StringSplit(tables[i].id);
			} else {
				var flag = isReplyCode(tables[i].id);
				var strLength = StringSplit(tables[i].id);
				if (flag == true){
					tables[i].style.margin="0px,0px,10px,"+(25*(strLength-minLength))+"px";
				} else {
					tables[i].style.margin="0px,0px,10px,"+(20*(strLength-minLength))+"px";
				}
			}
		}
	}
	 document.getElementById("contentList").value = arr;
}

function StringSplit(str){
	var strList= new Array();
	strList = str.split("-");
	return strList.length;
}

//是否是特殊节点
function isReplyCode(str){
	var regu = "s";
	if (str.search(regu)!=-1)
	{
		return true;
	}
	else{
		return false;
	}
}
-->
</script>
{% endblock %}
{% block body %}
<body   style="background:#ececec">
{% endblock %}
{% block navigator %}
<a  href="/contentList/0">资讯内容管理</a> 
{% for fList in fatherList%}
{% if fList.code%}
 >> <a href="/contentList/0?father={{fList.code}}">{{fList.title}}</a>
{%endif%}
{% endfor%}
>><a >修改资讯内容</a> >> <a href="javascript:history.back(-1);">后退</a>
{% endblock %}
{% block content %}
<form action="/contentUpdate" method="post">

<table id="main" width="90%" cellpadding="1" cellspacing="1" border="0" bgcolor="#D5E3E6"> 
<tr bgcolor="#ffffff" ><td> 
<input type="hidden" name="page_id" value="{{index}}"/>
 <input type="hidden" name="father" value="{{father}}"/>
 <input id="contentList" type="hidden" name="contentList" value=""/>
{% for cList in contentList %}
{% if cList %}
{{cList.code}}<br>
{% if cList.replyType%}
<table id="{{cList.code}}"  width="90%" cellpadding="1" cellspacing="1" border="0" bgcolor="#D5E3E6"> 
<tr  bgcolor="#ffffff" >
<td width="7%">回复类别：</td>
<td width="15%"><input type="text" name="replyType_{{cList.code}}" value="{{cList.replyType}}"></br>1.单选项。2.多选项。3.图文显示。4.文本回复
	</td>
<td width="78%">状态：<select name="status_{{cList.code}}">
<option value="0" {%ifequal cList.status '0'%} selected {%endifequal%}>0</option>
<option value="1" {%ifequal cList.status '1'%} selected {%endifequal%}>1</option>
</select></td>
</tr>
<tr  bgcolor="#ffffff" >
<td width="7%">内容：</td>
<td colspan="2"><textarea name="content_{{cList.code}}" cols="70" rows="13">{{cList.content}}
</textarea></td>
</tr>
</table>
{%else%}
<table id="{{cList.code}}" width="90%" cellpadding="1" cellspacing="1" border="0" bgcolor="#D5E3E6" > 
<tr  bgcolor="#ffffff" >
<td width="7%">标题：</td>
<td width="18%"><input name="title_{{cList.code}}" type="text" value="{{cList.title}}"></td>
<td width="44%">状态：<select name="status_{{cList.code}}">
<option value="0" {%ifequal cList.status '0'%} selected {%endifequal%}>0</option>
<option value="1" {%ifequal cList.status '1'%} selected {%endifequal%}>1</option>
</select></td>
</tr>
<tr  bgcolor="#ffffff" >
<td width="11%">上次更新时间：</td>
<td width="20%"><input name="lastUpdateTime_{{cList.code}}" type="text" value="{{cList.lastUpdateTime}}"></td>
<td width="44%">更新时间间隔：<input name="updateSpanTime_{{cList.code}}" type="text" value="{{cList.updateSpanTime}}"></td>
</tr>
<tr  bgcolor="#ffffff" >
<td width="7%">内容：</td>
<td colspan="2"><textarea name="content_{{cList.code}}" cols="70" rows="13" >{{cList.content}}
</textarea></td>
</tr>
</table>
{%endif%}
{%endif%}
{%endfor%}
</td>
</tr>
<tr  bgcolor="#ffffff" >
    <td colspan="2" align="center">
      <input type="submit" name="Submit" value="确定"/>
	  <input type="reset" name="Reset" value="重置"/>
	  <input type="button" name="Return" value="返回" onClick="javascript:history.back(-1);" />  </td>
  </tr>
</table>
</form>
{% endblock %}